/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hutech09.jsale.web.beans;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.hutech09.jsale.bsn.ISupplierManager;
import org.hutech09.jsale.entity.Supplier;

/** 
 *
 * @author Nam
 */
@ManagedBean(eager = true)
@RequestScoped
public class SupplierCreateController {

    private Supplier supplier = new Supplier();

    @EJB
    private ISupplierManager supplierManager;

    public SupplierCreateController() {
        System.err.println("is created");
    }

    public Supplier getSupplier() {
        return supplier;  
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    public String create() {
        supplierManager.create(supplier);
        return "supplier.xhtml";
    }
}
